package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.RatesDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.RatesManager;
import com.hanoiwiki.model.Rates;

@Component
@Transactional
public class RatesManagerImpl extends BaseManagerImpl implements RatesManager{

	@Autowired
	private RatesDAO ratesDAO;
	
	@Override
	public void save(Rates rates) {
		try {
			ratesDAO.save(rates);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

	@Override
	public void update(Rates rates) {
		try {
			ratesDAO.update(rates);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

	@Override
	public Rates get(Integer id) {
		try {
			return ratesDAO.get(id);
		} catch (DataAccessException e) {
			log.error("", e);
		}
		return null;
	}

	@Override
	public List<Rates> getList() {
		try {
			return ratesDAO.getList();
		} catch (DataAccessException e) {
			log.error("", e);
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			ratesDAO.remove(id);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

}
